using System.Collections;
    public class ConstantsManager
    {
        private IList timeRegisterTypes;

        private static ConstantsManager constantsManager;

        public static ConstantsManager GetInstance()
        {
            if (constantsManager == null)
                constantsManager = new ConstantsManager();
            return constantsManager;
        }

        private ConstantsManager()
        {
            timeRegisterTypes = new ArrayList(3);
            timeRegisterTypes.Add(new ConstantKeyValue(TimeRegisterType.Scheduled, "Scheduled"));
            timeRegisterTypes.Add(new ConstantKeyValue(TimeRegisterType.NotScheduled, "Not Scheduled"));
            timeRegisterTypes.Add(new ConstantKeyValue(TimeRegisterType.Break, "Break"));
        }


        public IList TimeRegisterTypes
        {
            get { return timeRegisterTypes; }
        }

        public string GetTimeRegisterValue(int type)
        {
            return GetResource(type, timeRegisterTypes);
        }

        private string GetResource(int key, IList items)
        {
            for (int i = 0; i < timeRegisterTypes.Count; i++)
            {
                ConstantKeyValue type = (ConstantKeyValue) timeRegisterTypes[i];
                if (type.Key == key)
                {
                    return type.Value;
                }
            }
            return string.Empty;
        }
    }

    public class ConstantKeyValue
    {
        private int key;
        private string value;

        public ConstantKeyValue(int key, string value)
        {
            this.key = key;
            this.value = value;
        }

        public int Key
        {
            get { return key; }
            set { key = value; }
        }

        public string Value
        {
            get { return value; }
            set { this.value = value; }
        }
    }

    public static class TimeRegisterType
    {
        public static readonly int Scheduled = 0;
        public static readonly int NotScheduled = 1;
        public static readonly int Break = 2;
    }
